package com.itheima.mybatisplus01.bean;

import com.baomidou.mybatisplus.annotation.*;
import com.itheima.mybatisplus01.sexEnum.Sex;
import lombok.Data;

import java.util.Date;

@Data
@TableName("tb_user")
public class User {
    //代表主键，数据库id自增
    @TableId(type = IdType.AUTO)
    private Long id;
    private String userName;
    private String password;
    private Integer age;
    private String name;
    private Sex sex;
    private String email;
    @TableLogic//逻辑删除
    private Integer deleted;
    @Version//乐观锁注解
    private Integer version;
    //插入时赋值
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    //更新插入都赋值
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
